// JavaScript Document
sendRequestPost("./home/src/default/home/showNews.php",null,document.getElementById("v_news"));
sendRequestPost("./home/src/default/home/hotNews.php",null,document.getElementById("v_hots"));
sendRequestPost("./home/src/default/home/members.php",null,document.getElementById("v_members"));
sendRequestPost("./home/src/default/home/bottom.php",null,document.getElementById("footer"));
function showmore(){
	sendRequestPost("./home/src/default/home/showNews.php",null,document.getElementById("v_news"));
}
var time=5;
var oldHtml='';
var morePages=4;
var isSetInterval=false;
window.onscroll=function(){
	var a = document.documentElement.scrollTop==0? document.body.clientHeight : document.documentElement.clientHeight;
	var b = document.documentElement.scrollTop==0? document.body.scrollTop : document.documentElement.scrollTop;
	var c = document.documentElement.scrollTop==0? document.body.scrollHeight : document.documentElement.scrollHeight;

	if(a+b>=c*4/5&& isSetInterval==false&&morePages>0){
		
		isSetInterval=true;
		var tt=setInterval(function(){
			time--;
			isSetInterval=false;
			if(time<=1){
				time=5;
				isSetInterval=false;
				showmore();
				morePages--;
				window.clearInterval(tt);
				return;
			}
		}, 1000);
	}
}